﻿@{
    ViewBag.Title = "项目列表";
}
@using QDT.Core
@using QDT.Core.Projects
@using QDT.Web
@using QDT.Web.Code
@model QDT.Common.IPagedList<QDT.Core.Projects.Project>

<div id="jm-touch">
    <div class="tabs"><a href="@Url.Action("ProjectList","Home")"  class="active ">项目列表</a><span class="split-line">|</span><a href="@Url.Action("Assignment","Home")">债权转让</a></div>
    <div class="spaceholder"></div>
    <div id="jm-projects" class="project-list"><!--div.hd.recommendspan 项目列表-->
        <div class="bd">
       @foreach (var project in Model)
{
    var agency = Html.F().GetAgency(project.Parent.AgencyId);
       <a href="@Url.Action("ProjectDetail", "Home",new{id=project.ID})" class="project InBid">
        <div class="tit"><span class="category">@project.Name</span>
           
                 @if (agency == null)
                 {
                         <span>资产抵押</span>
                 }
                 else
                 {
                     <span>@agency.SubName</span>
                 }
           
            </div>
        <div class="company">
            @(string.IsNullOrWhiteSpace(project.Parent.IndustryDetail) ? "" : project.Parent.IndustryDetail)
        </div>
        <div class="progress">
            <div style="width: @(project.Progress.ToString("0.0") + '%')" class="balances inbid">&nbsp;</div>
        </div>
        <div class="profit-c">
            <table>
                <tbody>
                    <tr>
                        <td><span class="profit">@project.Rate</span><span class="symbol">.00%</span></td>
                        <td><span class="maturity">@project.RepayTime</span><span class="symbol">个月</span></td>
                        <td><span class="amout">@project.BorrowAmount.ToMoney("F", 10000.00)</span><span class="symbol">万</span></td>
                    </tr>
                </tbody>
            </table>
        </div>
        <div class="invest">
            <span href="@Url.Action("ProjectDetail", "Home")" class="inbid">
                 @switch (project.Status)
                 {
                     case ProjectStatus.Full:
                            <span>
                                已满 </span>
                
                         break;
                     case ProjectStatus.Repaying:
                            <span>
                                还款中 </span>
                         break;
                     case ProjectStatus.Repaid:
                            <span>
                                已还完 </span>
                
                         break;
                     case ProjectStatus.Progress:
                            <span>
                                @(project.StartTime.Value > DateTime.Now ? @project.StartTime.Value.ToString("HH:mm") + ' ' + "开售" : "投资")
                            </span>
                            break;
                     case ProjectStatus.Bad:
                            <span>
                                流标 </span>
                            break;
                     case ProjectStatus.Wait:
                            <span>
                                等待 </span>
                            break;
                 }
            </span>
            
            <div class="inbid">&nbsp;</div>
        </div>
    </a>
}
        </div>
        <div class="more"><a href="@Url.Action("ProjectList","Home",new{num=ViewBag.pageSize})">加载更多项目</a></div>
    </div>
</div>
